home *** CD-ROM | disk | FTP | other *** search
- /*
- * LaCube NullObject Options Script
- *
- * name: LoadStream
- * param: stream (wave, ogg) filename to load
- * description: loads a stream file and put it into nullobject's option
- * code: Lettique
- * last modification: May 1st, 2005, 23:44
- *
- * comment: pity that Angel doesnt know what void** ppPtr = &pPtr; means...
- *
- * parameters:
- * - pFileName [in] - a file name to load, shall be in the same directory as the scene is
- * - fMin [in] - minimum distance (where attenuation starts)
- * - fMax [in] - maximum distance (where attenuation ends - the sound is no longer audible)
- * - Flags [in] - flags, one of LACUBE::MusiqueStream, adnotice that Angel doesnt have enums yet, so
- * the value shall be passed ie for stream_loop, 32 shall be passed:
- * stream_ctrl3d = 1, - set by default, every sound stream is then 3D sound
- * stream_ctrlfrequency = 8,
- * stream_loop = 32,
- * - Start [in] - shall the sound start after running the scene it's attached to (1 - yes, 0 - no)
- *
- */
-
- void LoadStream( bstr pFileName, float fMin, float fMax, uint Flags, uint Start )
- {
- CNullInterface* pNull = GetNullParent();
- CLaCubeD3DInterface* pLaCube = GetLaCubeD3DInterface();
- MusiqueInterface* pMusique = pLaCube->GetMusiqueInterface();
-
- MusiqueStream* pStream = 0;
- pMusique->LoadStream( pFileName, pStream, Flags + 1 ); // 1 - MusiqueStream::stream_ctrl3d
-
- if ( pStream != 0 )
- {
- CNullOptionsInterface* pOptions = pNull->GetNullOptions();
- pOptions->SetOption( 2, pStream, Start ); // 2 - option_musique_stream
-
- pStream->SetMinDistance( fMin );
- pStream->SetMaxDistance( fMax );
- }
- }